{% extends 'myadmin/base.html' %}
{%block body%}
<div class="tpl-content-wrapper">
            <div class="tpl-content-page-title">
                Amaze UI 文字列表
            </div>
            <ol class="am-breadcrumb">
                <li><a href="#" class="am-icon-home">首页</a></li>
                <li><a href="#">Amaze UI CSS</a></li>
                <li class="am-active">文字列表</li>
            </ol>
            <div class="tpl-portlet-components">
                <div class="portlet-title">
                    <div class="caption font-green bold">
                        <span class="am-icon-code"></span> 商品列表
                    </div>
                    <div class="tpl-portlet-input tpl-fz-ml">
                        <div class="portlet-input input-small input-inline">
                        
                        </div>
                    </div>


                </div>
                <div class="tpl-block">
                    <form action="">
                    <div class="am-g">
                        <div class="am-u-sm-12 am-u-md-6">
                            <div class="am-btn-toolbar">
                                
                            </div>
                        </div>
                        <div class="am-u-sm-12 am-u-md-3">
                            <div class="am-form-group">
                                <select name="type" data-am-selected="{btnSize: 'sm'}" style="display: none;">
                                    <option {% if request.GET.type == 'all' %}selected {% endif %} value="all">所有类别</option>
                                    <option {% if request.GET.type == 'gname' %}selected {% endif %} value="name">商品名称</option>
                                </select>
                            </div>
                        </div>
                        <div class="am-u-sm-12 am-u-md-3">
                            <div class="am-input-group am-input-group-sm">
                                <input type="text" class="am-form-field" value="{{request.GET.search}}" name="search">
                                <span class="am-input-group-btn">
            <button class="am-btn  am-btn-default am-btn-success tpl-am-btn-success am-icon-search" type="submit"></button>
          </span>
                            </div>
                        </div>
                    </div>


                        </form>
                    <div class="am-g">
                        <div class="am-u-sm-12">
                            <form class="am-form">
                                <table class="am-table am-table-striped am-table-hover table-main">
                                    <thead>
                                            <tr>
                                                <th>ID</th>
                                                <th>商品名称</th>
                                                <th>图片</th>
                                                
                                                <th>库存</th>
                                                <th>单价</th>
                                                <th>添加时间</th>
                                                <th>操作</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            {% for i in goods %}
                                            <tr>
                                                <td>{{ i.id }}</td>
                                                <td>{{ i.gname }}</td>
                                                <td><img src="{{ i.gimgurl }}" width="50" ></td>
                                                
                                                <td>{{ i.gordernum }}</td>
                                                <td>{{ i.gprice }}</td>
                                                <td>{{ i.gaddtime }}</td>
                                                <td>
                                                    <a href="{% url 'myadmin_editgoods' %}?id={{ i.id }}">
                                                        <i class="am-icon-trash"></i>编辑
                                                    </a>
                                                    <a href="{% url 'myadmin_delgoods' %}?id={{ i.id }}">
                                                        <i class="am-icon-trash"></i>删除
                                                    </a>
                                                </td>
                                            </tr>
                                            {% endfor %}
                                        </tbody>
                                </table>
                                <div class="am-cf">

                                    <div class="am-fr">
                                        <ul class="am-pagination tpl-pagination">
                                            <li ><a href="{% url 'myadmin_goodslist' %}?p=1&type={{request.GET.type}}&search={{request.GET.search}}">首页</a></li>

                                            <li {% if page == 1 %}class="am-disabled"{% endif %}><a href="{% url 'myadmin_goodslist' %}?p={{page|add:-1}}&type={{request.GET.type}}&search={{request.GET.search}}">«</a></li>
                                            {% for i in prange %}
                                            <li {% if page == i %} class="am-active" {% endif %}><a href="{% url 'myadmin_goodslist' %}?p={{i}}&type={{request.GET.type}}&search={{request.GET.search}}">{{i}}</a></li>
                                            {% endfor %}
                                            <li {% if page == sumpage %}class="am-disabled"{% endif %}><a href="{% url 'myadmin_goodslist' %}?p={{page|add:1}}&type={{request.GET.type}}&search={{request.GET.search}}">»</a></li>

                                            <li ><a href="{% url 'myadmin_goodslist' %}?p={{sumpage}}&type={{request.GET.type}}&search={{request.GET.search}}">尾页</a></li>
                                        </ul>
                                    </div>
                                </div>
                                <hr>

                            </form>
                        </div>

                    </div>

                </div>
                <div class="tpl-alert"></div>
            </div>










        </div>
{%endblock%}